package cn.edu.lingnan.fruitshop.service;

import cn.edu.lingnan.fruitshop.common.JSONResult;
import cn.edu.lingnan.fruitshop.pojo.User;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 张小凡
 * @since 2022-01-04
 */
public interface UserService extends IService<User> {

    //验证邮箱是否唯一 以及格式
    JSONResult<Void> checkEmail(String email);

    // 发送邮箱验证码
    JSONResult<Void> sendEmailCode(String email, HttpSession session);

    // 进行注册
    JSONResult<Void> doReg(String email,String password,String comfirmPwd,String code,String option,HttpSession session);

    // 验证两次密码是否一致
    JSONResult<Void> checkPasswordAndComfirmPwd(String password,String ComfirmPwd);

    // 登录时验证邮箱是否存在
    JSONResult<Void> checkLoginEmail(String email);


    // 用户进行登录操作
    public JSONResult<Void> doLogin(String email,String password,String code,HttpSession session);

    // 用户进行密码重置操作
    public JSONResult<Void> doResetPwd(String email,String password,String comfirmPwd,String code,HttpSession session);


    // 重置密码时发送邮箱验证码
    public JSONResult<Void> resetPwdSendEmailCode(String email,HttpSession session);

}
